<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Cache-Control" content="no-cache" />
<meta http-equiv="Progma" content="no-cache" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/mm_training.css" type="text/css" />
<link rel="stylesheet" href="<%=request.getContextPath()%>/css/user.css" type="text/css" />
<link type="text/css" href="<%=request.getContextPath()%>/css/smoothness/jquery-ui-1.7.1.custom.css" rel="stylesheet" />
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/jquery/jquery-1.3.2.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/jquery/jquery-ui-1.7.1.custom.js"></script>
<script type="text/javascript">
	/** 重命名jQuery */
	$j = jQuery.noConflict();
</script>
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/prototype/prototype-1.6.0.3.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/scripts/XunjiaUtils.js"></script>
<script type="text/javascript">
	function goNextPage() {
		var context = "<%=request.getContextPath()%>";
		document.location.href = context + "/registion/purchase.do";
	}
	function goPreviousPage() {
		var context = "<%=request.getContextPath()%>";
		document.location.replace(context + "/registion/img.do?previous=previous");
	}
	
	$j(function () {
		$j("#todate").datepicker({ 
			altFormat: 'yy-mm-dd', 
			dateFormat:'yy-mm-dd', 
			gotoCurrent: true,
			monthNames: ['一月','二月','三月','四月','五月','六月','七月','八月','九月','十月','十一月','十二月'] ,
			dayNames: ['日', '一', '二', '三', '四', '五', '六'],
			dayNamesShort:['日', '一', '二', '三', '四', '五', '六'],
			dayNamesMin:['日', '一', '二', '三', '四', '五', '六']
		});
	});
</script>
<style type="text/css">
td {
	font-size: 12px;
}

span {
	color: red;
}

body {
	font-size: 12px;
}

.err_msg {
	color: red;
}
</style>
<title>上传广告图片</title>
</head>
<body bgcolor="#64748B">
<form action="<%=request.getContextPath()%>/registion/createImageAdvertisment.do" method="post" enctype="multipart/form-data">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
	<tr bgcolor="#26354A">
		<td width="15" nowrap="nowrap"><img src="<%=request.getContextPath()%>/images/mm_spacer.gif" alt="" width="15" height="1" border="0" /></td>
		<td height="70" colspan="3" class="logo" nowrap="nowrap">Yam廣告聯盟<span class="tagline">| yam of sichuan</span></td>
		<td width="40">&nbsp;</td>
		<td width="100%">&nbsp;</td>
	</tr>
	<tr bgcolor="#FF6600">
		<td colspan="6"><img src="<%=request.getContextPath()%>/images/mm_spacer.gif" alt="" width="1" height="4" border="0" /></td>
	</tr>
	<tr bgcolor="#D3DCE6">
		<td colspan="6"><img src="<%=request.getContextPath()%>/images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
	</tr>
	<tr bgcolor="#FFCC00">
		<td width="15" nowrap="nowrap">&nbsp;</td>
		<td width="705" colspan="3" height="24">
		<table border="0" cellpadding="0" cellspacing="0" id="navigation">
			<tr>
				<td class="navText" align="center" nowrap="nowrap"><a href="<%=request.getContextPath()%>/index.do">返回首页</a></td>
				<td class="navText" align="center" nowrap="nowrap"></td>
				<td class="navText" align="center" nowrap="nowrap"></td>
				<td class="navText" align="center" nowrap="nowrap"></td>
				<td class="navText" align="center" nowrap="nowrap"></td>
				<td class="navText" align="center" nowrap="nowrap"></td>
			</tr>
		</table>
		</td>
		<td width="40"></td>
		<td width="100%"></td>
	</tr>
	<tr bgcolor="#D3DCE6">
		<td colspan="6"><img src="<%=request.getContextPath()%>/images/mm_spacer.gif" alt="" width="1" height="1" border="0" /></td>
	</tr>
	<tr bgcolor="#FF6600">
		<td colspan="6"><img src="<%=request.getContextPath()%>/images/mm_spacer.gif" alt="" width="1" height="4" border="0" /></td>
	</tr>
	<tr bgcolor="#D3DCE6">
		<td width="230" valign="top" bgcolor="#26354a" colspan="2">
		<table width="230" bgcolor="#26354a" cellspacing="0" cellpadding="0" border="0">
			<tr>
				<td width="230" class="pageName" style="font-size: 14px;"></td>
			</tr>
			<tr>
				<td width="230" class="pageName" style="font-size: 14px;"></td>
			</tr>
		</table>
		</td>
		<td width="50" valign="top"><img width="50" height="1" border="0" alt="" src="<%=request.getContextPath()%>/images/mm_spacer.gif" /></td>
		<td width="440" valign="top">
		<table width="440" cellspacing="0" cellpadding="0" border="0">
			<tbody>
				<tr>
					<td colspan="2">您選擇的廣告位支持圖片為:500*100 每天需要支付 5000.00 臺幣!</td>
				</tr>
				<tr>
					<td colspan="2"><br />
					<input type="file" name="uploadimg" id="uploadimg"/> &nbsp;&nbsp;&nbsp;<span style="color: red;">*</span>可接受的格式:.gif,.jpg,.png,.swf<s:fielderror fieldName="uploadimg"/><s:actionerror/> </td>
				</tr>
				<tr>
					<td>购买日期到<span style="color: red;">*</span></td>
					<td><input type="text" id="todate" name="todate" readonly="readonly" value="<s:property value="todate"/>"/><s:property value="todate"/>广告位至少购买一周<s:fielderror fieldName="todate"/></td>
				</tr>
				<tr>
					<td>给此图片命名<span style="color: red;">*</span></td>
					<td><input type="text" id="imgname" name="imgname" value="<s:property value='imgname'/>"/><s:property value="imgname"/>最多50个英文字元或25个中文字元<s:fielderror fieldName="imgname"/></td>
				</tr>
				<tr>
					<td>显示URL:<span style="color: red;">*</span></td>
					<td>http://<input type="text" id="url" name="url" value="<s:property value="url"/>"/>最多35个字元<s:fielderror fieldName="url"/></td>
				</tr>
				<tr>
					<td>目的地网址<span style="color: red;">*</span></td>
					<td><select id="protocol" name="protocol">
						<option value="http://">http://</option>
						<option value="https://">https://</option>
					</select> <input type="text" id="link" name="link" value="<s:property value="link"/>" />最多1024个字元<s:fielderror fieldName="link"/></td>
				</tr>
				<tr>
					<td colspan="2">需要支付 (?)5000.00 臺幣!</td>
				</tr>
				<tr>
					<td colspan="2"><input type="checkbox" name="accept" id="accept" /> 勾选此方块,你即授权Google代你调整任何你送出的图片广告</td>
				</tr>
				<tr>
					<td width="51%" align="right"><input type="button" name="preStep" id="preStep" value="上一步" onclick="goPreviousPage();" /></td>
					<td width="51%" align="left"><input type="submit" name="nextStep" id="nextStep" value="下一步"/></td>
				</tr>
			</tbody>
		</table>
		</td>
		<td width="40">&nbsp;<input type="hidden" name="position" value="<s:property value="position"/>" id="position" /></td>
		<td width="100%">&nbsp;<input type="hidden" name="previous" value="<s:property value="previous"/>" id="previous"/></td>
	</tr>
	<tr bgcolor="#D3DCE6">
		<td colspan="6"><img src="<%=request.getContextPath()%>/images/mm_spacer.gif" width="1" height="1" border="0" /></td>
	</tr>
</table>
</form>
<script type="text/javascript">
	function init() {
		document.write(cookies);
		// 获取广告对象
		var cookieInfo = CookieUtils.getJSONValue('COOKIE_REGISTE_ADVERTISEMENT_IMAGE');
		var href = cookieInfo.href;
		if (!StringUtils.isEmpty(href)) {
			// 设置关键字
			$j("#todate").val(StringUtils.getString(cookieInfo.endTime));
			$j("#imgname").val(StringUtils.getString(cookieInfo.advName));
			if (!StringUtils.isEmpty(cookieInfo.URL)) {
				$j("#url").val(StringUtils.getString(cookieInfo.URL.substring(cookieInfo.URL.indexOf("://") + 3 , cookieInfo.URL.length)));
			}
			if (!StringUtils.isEmpty(cookieInfo.href)) {
				$j("#protocol").val(StringUtils.getString(cookieInfo.href.substring(0,cookieInfo.href.indexOf("://") + 3)));
				$j("#link").val(StringUtils.getString(cookieInfo.href.substring(cookieInfo.href.indexOf("://") + 3 , cookieInfo.href.length)));
			}
		}
	}
	init();
</script>
</body>
</html>